package com.imut.oa.controller.admin;

import com.imut.oa.common.BaseResponse;
import com.imut.oa.common.PageResult;
import com.imut.oa.common.ResultUtils;
import com.imut.oa.pojo.dto.LeavePageQueryDTO;
import com.imut.oa.pojo.dto.MessagesPageQueryDTO;
import com.imut.oa.service.LeaveService;
import com.imut.oa.service.MessagesService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/messages")
@Slf4j
@Tag(name = "留言管理")
public class MessagesController {
    @Autowired
    private MessagesService messagesService;
    @GetMapping("/page")
    @Operation(summary = "留言分页查询")
    public BaseResponse<PageResult> page (MessagesPageQueryDTO messagesPageQueryDTO){
        log.info("留言分页查询：{}",messagesPageQueryDTO);
        PageResult pageResult = messagesService.getMessagesPage(messagesPageQueryDTO);
        return ResultUtils.success(pageResult);
    }
}
